#ifndef _AK_CSRV_H_
#define _AK_CSRV_H_

/* command format: "cmd,arg" */
typedef void (*parse_callback)(char *cmd_buf);

struct csrv_param {
    void *vi_handle;
    int day_level_ctrl;
};

/**
 * ak_csrv_get_version - get csrv version
 * return: version string
 * notes: make sure get the correct version before analyze problem
 */
const char* ak_csrv_get_version(void);

/*
 * ak_csrv_sysipc_init - just init a socket for client
 * return: on success return a file descriptor for new socket,
 * 		   on fail -1 is return
 */
int ak_csrv_sysipc_init(void);

/*
 * ak_csrv_sysipc_exit - close ipc service
 * sock[IN]: return by init
 * return: 0 on success, -1 failed
 */
int ak_csrv_sysipc_exit(int sock);

/**
 * ak_csrv_cmd_init_server: init cmd server
 * @parse_cb: cmd parse callback
 * return: 0 success, -1 failed
 * notes: register parse message callback, and start internal working.
 */
int ak_csrv_cmd_init_server(parse_callback parse_cb);

/**
 * ak_csrv_cmd_exit_server: exit cmd server
 * return: void
 */
void ak_csrv_cmd_exit_server(void);

#endif
